package leet.ku._226;

class TreeNode {
	int val;
	TreeNode left;
	TreeNode right;

	TreeNode(int x) {
		val = x;
	}
}

public class Solution {
	
	public TreeNode invertTree(TreeNode root) {
		if (root == null)
			return null;
		
		TreeNode now = new TreeNode(root.val);
		now.left = invertTree(root.right);
		now.right = invertTree(root.left);
		return now;
	}
}
